package com.fudan.gamestore.service;

import com.fudan.gamestore.pojo.Order;
import com.fudan.gamestore.pojo.OrderItem;
import com.github.pagehelper.PageInfo;

import java.util.List;

public interface OrderService {
    PageInfo<Order> getOrderByUserIdPage(Integer userId, Integer size, Integer pageNum);

    List<OrderItem> getOrderItemsByOrderId(Integer orderId);

    PageInfo<Order> getAllOrderByPage(Integer size, Integer pageNum);

    int setOrderState(Integer orderId, Integer state);

    int deleteOrderByOrderId(Integer orderId);

    Order getOrderByOrderId(Integer orderId);

    List<Integer> getGameIdListByOrderId(Integer orderId);

    /**
     * 创建订单
     *
     * @param userId     用户ID
     * @param gameIdList 游戏ID列表
     * @return 成功时返回订单ID
     */
    int insertOrder(Integer userId, List<Integer> gameIdList);

    int finishOrderAfterPay(Integer orderId);
}
